package com.llk.util;

import java.util.UUID;

import android.content.Context;
import android.telephony.TelephonyManager;

public class Util {
	
	public static String getDiscount(float salePrice,float marketPrice){
		String zk=new java.text.DecimalFormat("0.#").format(salePrice*10/marketPrice*1d);
		return zk;
	}
	
	public static String getUUID(Context context){
		final TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);    
		final String tmDevice, tmSerial, tmPhone, androidId;  
//		tmDevice = "" + tm.getDeviceId();     
//		tmSerial = "" + tm.getSimSerialNumber();   
//		androidId = "" + android.provider.Settings.Secure.getString(context.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);  
//		UUID deviceUuid = new UUID(androidId.hashCode(), ((long)tmDevice.hashCode() << 32) | tmSerial.hashCode());  
		String uniqueId = tm.getDeviceId().toString(); 
		return uniqueId;
	}
}
